home *** CD-ROM | disk | FTP | other *** search
/ JCSM Shareware Collection 1996 September / JCSM Shareware Collection (JCS Distribution) (September 1996).ISO / prgtools / czlis110.zip / DEMOALL.FRM < prev    next >
Text File  |  1994-10-29  |  7KB  |  301 lines

  1. Version 1.00
  2. BEGIN Form frmDemoAll
  3.     AutoRedraw   = 0
  4.     BackColor    = QBColor(7)
  5.     BorderStyle  = 2
  6.     Caption      = "CzDir and CzFile Together"
  7.     ControlBox   = -1
  8.     Enabled      = -1
  9.     ForeColor    = QBColor(0)
  10.     Height       = Char(25)
  11.     Left         = Char(0)
  12.     MaxButton    = -1
  13.     MinButton    = -1
  14.     MousePointer = 0
  15.     Tag          = ""
  16.     Top          = Char(0)
  17.     Visible      = -1
  18.     Width        = Char(80)
  19.     WindowState  = 0
  20.     BEGIN Custom CzFile
  21.         Action       = 0
  22.         Alignment    = 0
  23.         Archive      = 0
  24.         AutoRedraw   = 0
  25.         BackColor    = QBColor(7)
  26.         BorderStyle  = 1
  27.         Caption      = ""
  28.         Checked      = 0
  29.         Column       = 0
  30.         DragMode     = 0
  31.         Drive        = ""
  32.         Enabled      = -1
  33.         Filename     = ""
  34.         ForeColor    = QBColor(0)
  35.         Height       = Char(21)
  36.         Hidden       = 0
  37.         Interval     = 0
  38.         LargeChange  = 0
  39.         Left         = Char(25)
  40.         ListCount    = 0
  41.         ListIndex    = 0
  42.         Max          = 0
  43.         Min          = 0
  44.         Mode         = 0
  45.         MousePointer = 0
  46.         MultiLine    = 0
  47.         Normal       = 0
  48.         Path         = ""
  49.         Pattern      = ""
  50.         ReadOnly     = -1
  51.         Row          = 0
  52.         ScrollBars   = 0
  53.         SelLength    = 0
  54.         SelStart     = 0
  55.         SelText      = ""
  56.         SmallChange  = 0
  57.         Sorted       = 0
  58.         Style        = 0
  59.         System       = 0
  60.         TabIndex     = 0
  61.         TabStop      = -1
  62.         Tag          = ""
  63.         Text         = ""
  64.         Top          = Char(1)
  65.         TypeID       = "CzFile"
  66.         Value        = 0
  67.         Visible      = -1
  68.         Width        = Char(53)
  69.     END
  70.     BEGIN Custom CzDir
  71.         Action       = 0
  72.         Alignment    = 0
  73.         Archive      = 0
  74.         AutoRedraw   = 0
  75.         BackColor    = QBColor(7)
  76.         BorderStyle  = 1
  77.         Caption      = ""
  78.         Checked      = 0
  79.         Column       = 0
  80.         DragMode     = 0
  81.         Drive        = ""
  82.         Enabled      = -1
  83.         Filename     = ""
  84.         ForeColor    = QBColor(0)
  85.         Height       = Char(21)
  86.         Hidden       = 0
  87.         Interval     = 0
  88.         LargeChange  = 0
  89.         Left         = Char(0)
  90.         ListCount    = 0
  91.         ListIndex    = 0
  92.         Max          = 0
  93.         Min          = 0
  94.         Mode         = 0
  95.         MousePointer = 0
  96.         MultiLine    = 0
  97.         Normal       = 0
  98.         Path         = ""
  99.         Pattern      = ""
  100.         ReadOnly     = -1
  101.         Row          = 0
  102.         ScrollBars   = 0
  103.         SelLength    = 0
  104.         SelStart     = 0
  105.         SelText      = ""
  106.         SmallChange  = 0
  107.         Sorted       = 0
  108.         Style        = 0
  109.         System       = 0
  110.         TabIndex     = 2
  111.         TabStop      = -1
  112.         Tag          = ""
  113.         Text         = ""
  114.         Top          = Char(1)
  115.         TypeID       = "CzDir"
  116.         Value        = 0
  117.         Visible      = -1
  118.         Width        = Char(25)
  119.     END
  120.     BEGIN CommandButton cmdCancel
  121.         BackColor    = QBColor(7)
  122.         Cancel       = -1
  123.         Caption      = "&End Demo"
  124.         Default      = 0
  125.         DragMode     = 0
  126.         Enabled      = -1
  127.         Height       = Char(1)
  128.         Left         = Char(27)
  129.         MousePointer = 0
  130.         TabIndex     = 1
  131.         TabStop      = -1
  132.         Tag          = ""
  133.         Top          = Char(22)
  134.         Visible      = -1
  135.         Width        = Char(12)
  136.     END
  137.     BEGIN Label lblNumberOfDir
  138.         Alignment    = 2
  139.         AutoSize     = 0
  140.         BackColor    = QBColor(7)
  141.         BorderStyle  = 0
  142.         Caption      = "Label1"
  143.         DragMode     = 0
  144.         Enabled      = -1
  145.         ForeColor    = QBColor(0)
  146.         Height       = Char(1)
  147.         Left         = Char(0)
  148.         MousePointer = 0
  149.         TabIndex     = 4
  150.         Tag          = ""
  151.         Top          = Char(22)
  152.         Visible      = -1
  153.         Width        = Char(25)
  154.     END
  155.     BEGIN Label lblNumberOfFiles
  156.         Alignment    = 2
  157.         AutoSize     = 0
  158.         BackColor    = QBColor(7)
  159.         BorderStyle  = 0
  160.         Caption      = "Label1"
  161.         DragMode     = 0
  162.         Enabled      = -1
  163.         ForeColor    = QBColor(0)
  164.         Height       = Char(1)
  165.         Left         = Char(55)
  166.         MousePointer = 0
  167.         TabIndex     = 3
  168.         Tag          = ""
  169.         Top          = Char(22)
  170.         Visible      = -1
  171.         Width        = Char(22)
  172.     END
  173.     BEGIN CommandButton cmdCLSBox
  174.         BackColor    = QBColor(7)
  175.         Cancel       = 0
  176.         Caption      = "&CLS Box"
  177.         Default      = 0
  178.         DragMode     = 0
  179.         Enabled      = -1
  180.         Height       = Char(1)
  181.         Left         = Char(40)
  182.         MousePointer = 0
  183.         TabIndex     = 5
  184.         TabStop      = -1
  185.         Tag          = ""
  186.         Top          = Char(22)
  187.         Visible      = -1
  188.         Width        = Char(12)
  189.     END
  190. END
  191. DEFINT A-Z
  192.  
  193. '$FORM frmGeneral
  194. '$FORM frmOrder
  195.  
  196. DECLARE SUB AboutAll ()
  197.  
  198. SUB AboutAll ()
  199.  
  200.    a$ = "We will now show CzDir and CzFile working together. Try to change directories by pressing the ENTER key or by double-clicking with the left mouse button in the directory listbox."
  201. 'a$ = a$ + CHR$(13) + CHR$(10)
  202. 'a$ = a$ + CHR$(13) + CHR$(10) + "CzDir will first try to use XMS Memory. If no XMS memory is available, it will try to use EMS Memory. If no XMS and no EMS memory is available, CzDir will use the disk as virtual memory."
  203. MSGBOX a$, 0, "CzDir Demo"
  204.  
  205. END SUB
  206.  
  207. SUB cmdCancel_Click ()
  208.  
  209. ' You must UNLOAD the form or control(s) before you end your program. CzFile
  210. ' will then remove itself from memory. If you do not unload the form or
  211. ' control, the memory used by CzFile (either XMS, EMS, or disk space) will
  212. ' not be released and unpredictable results may occur.
  213. UNLOAD frmDemoAll
  214. frmOrder.SHOW 1
  215. END
  216.  
  217. END SUB
  218.  
  219. SUB cmdCLSBox_Click ()
  220.  
  221. CzFile.CLS
  222. CzFile.SETFOCUS
  223.  
  224. END SUB
  225.  
  226. SUB CzDir_DblClick ()
  227.  
  228. NewPath$ = MID$(CzDir.List(CzDir.ListIndex), 2)
  229.  
  230. IF RIGHT$(NewPath$, 1) <> "\" THEN
  231.    CzFile.Path = NewPath$ + "\*.*"
  232. ELSE
  233.    CzFile.Path = NewPath$ + "*.*"
  234. END IF
  235.  
  236. lblNumberOfDir.Caption = "Directories =" + STR$(CzDir.ListCount)
  237. lblNumberOfFiles.Caption = "Files =" + STR$(CzFile.ListCount)
  238.  
  239. END SUB
  240.  
  241. SUB CzDir_KeyDown (KeyCode AS INTEGER, Shift AS INTEGER)
  242.  
  243. ' Pressed the ENTER key
  244. IF KeyCode = 13 THEN
  245.    NewPath$ = MID$(CzDir.List(CzDir.ListIndex), 2)
  246.  
  247.    IF RIGHT$(NewPath$, 1) <> "\" THEN
  248.       CzFile.Path = NewPath$ + "\*.*"
  249.    ELSE
  250.       CzFile.Path = NewPath$ + "*.*"
  251.    END IF
  252.    lblNumberOfDir.Caption = "Directories =" + STR$(CzDir.ListCount)
  253.    lblNumberOfFiles.Caption = "Files =" + STR$(CzFile.ListCount)
  254. END IF
  255.  
  256. END SUB
  257.  
  258. SUB CzFile_KeyDown (KeyCode AS INTEGER, Shift AS INTEGER)
  259.  
  260. ' The ENTER key was pressed. Get the current element and display it.
  261. ' CzList.ListIndex is the current Index. You can also get any other
  262. ' index from 0 to ListCount. For example, to get element 189, use
  263. ' Dummy$ = CzList.List(188). Remember, the list starts with element 0.
  264. IF KeyCode = 13 THEN MSGBOX CzFile.List(CzFile.ListIndex), 0, "Pressed Enter Key"
  265.  
  266. END SUB
  267.  
  268. SUB Form_Load ()
  269.  
  270. AboutAll
  271.  
  272. ' Display status window
  273. frmGeneral.Label1.Caption = "One moment...reading disk information."
  274. frmGeneral.SHOW
  275.  
  276. ' Start reading the drive
  277. CzDir.Max = 299
  278. CzDir.Drive = "C:"
  279.  
  280. ' Unload status window from memory
  281. UNLOAD frmGeneral
  282.  
  283. ' Display status window
  284. frmGeneral.Label1.Caption = "One moment...reading file information."
  285. frmGeneral.SHOW
  286.  
  287. ' Start reading the drive
  288. CzFile.Max = 1999
  289. Dummy$ = CzDir.Drive + "\*.*"
  290. CzFile.Path = CzDir.Drive + "\*.*"
  291. CzFile.Sorted = -1
  292.  
  293. ' Unload status window from memory
  294. UNLOAD frmGeneral
  295.  
  296. lblNumberOfDir.Caption = "Directories =" + STR$(CzDir.ListCount)
  297. lblNumberOfFiles.Caption = "Files =" + STR$(CzFile.ListCount)
  298.  
  299. END SUB
  300.  
  301.